﻿/* 2014/2/12 */
using System.Collections;
using System.Collections.Generic;

namespace PictureManager.ClassifyFile
{
    /// <summary>
    /// The way of a file corresponding to a folder, according to the file name.
    /// </summary>
    enum CorrespondOption
    {
        Contain,
        StartWith,
        EndWith,
        Equal
    }

    class OptionInformation
    {
        private CorrespondOption _option;
        private string _description;

        public OptionInformation(CorrespondOption option, string description)
        {
            _option = option;
            _description = description;
        }

        public OptionInformation(CorrespondOption option)
            : this(option, null)
        {

        }

        public CorrespondOption Option { get { return _option; } }
        public string Description { get { return _description; } }
    }

    class OptionInformationCollection : IEnumerable<OptionInformation>
    {
        private OptionInformation[] _options;

        public OptionInformationCollection(params OptionInformation[] options)
        {
            _options = options;
        }

        public IEnumerator<OptionInformation> GetEnumerator()
        {
            for (int i = 0; i < _options.Length; i++)
                yield return _options[i];
        }

        IEnumerator IEnumerable.GetEnumerator()
        {
            return GetEnumerator();
        }
    }
}
